﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		ITrackBackService.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 // 
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion
 
using System;
using Dexter.Core.EventArgs;
using Dexter.Domain.Model;

namespace Dexter.Services {
	/// <summary>
	/// 	Rapresents the gateway for all service to save, retrieve and manipulate data for <see cref = "TrackBack" />.
	/// </summary>
	public interface ITrackBackService {
		/// <summary>
		/// Adds the <see cref="TrackBack"/> for the specified post.
		/// </summary>
		/// <param name="itemId">The item id of the post.</param>
		/// <param name="website">The website of the trackback.</param>
		/// <param name="title">The title.</param>
		void AddTrackBack ( int itemId , Uri website, string title );

		/// <summary>
		/// 	Determines whether is first ping back for the specified post slug.
		/// </summary>
		/// <param name = "postKey">The post key.</param>
		/// <param name = "url">The URL.</param>
		/// <returns>
		/// 	<c>true</c> if is first ping back; otherwise, <c>false</c>.
		/// </returns>
		bool IsFirstTrackbackBack ( int postKey, Uri url );

		/// <summary>
		/// 	This event will raise before a new <see cref = "TrackBack" /> processed by the implementation of <see cref = "AddTrackBack" />.
		/// </summary>
		event EventHandler<CancelEventArgsWithOneParameter<Tuple<int, Uri,string >>> TrackBackAdding;

		/// <summary>
		/// 	This event will raise after a new <see cref = "TrackBack" /> processed by the implementation of <see cref = "AddTrackBack" />.
		/// </summary>
		event EventHandler<GenericEventArgs<TrackBack>> TrackBackAdded;
	}
}
